<template>
	<j-cell-group :title="'通道' + index">
		<j-cell title="开启" :more="false">
			<view slot="tips">
				<switch :checked="AlarmNetAbort.Enable" disabled></switch>
			</view>
		</j-cell>
		<j-cell-card title="联动参数" :show="false" :is-touch="false" border style="background: #f5f7fb">
			<j-cell title="事件" :tips="AlarmNetAbort.EventHandler.EventLatch" :more="false"></j-cell>
			<j-cell title="事件时间段" :tips="AlarmNetAbort.EventHandler.TimeSection" :more="false"></j-cell>
			<j-cell title="录像通道掩码" :tips="AlarmNetAbort.EventHandler.RecordMask" :more="false"></j-cell>
			<j-cell title="录像" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.RecordEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="录像延时时间" :tips="AlarmNetAbort.EventHandler.RecordLatch" :more="false"></j-cell>
			<j-cell title="报警输出通道掩码" :tips="AlarmNetAbort.EventHandler.AlarmOutMask" :more="false"></j-cell>
			<j-cell title="报警输出" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.AlarmOutEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="报警输出延时时间" :tips="AlarmNetAbort.EventHandler.AlarmOutLatch" :more="false"></j-cell>
			<j-cell title="云台联动" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.PtzEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="云台联动项" :tips="AlarmNetAbort.EventHandler.PtzLink" :more="false"></j-cell>
			<j-cell title="轮询" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.TourEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="轮询掩码" :tips="AlarmNetAbort.EventHandler.TourMask" :more="false"></j-cell>
			<j-cell title="快照通道号掩码" :tips="AlarmNetAbort.EventHandler.SnapShotMask" :more="false"></j-cell>
			<j-cell title="抓图" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.SnapEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="本地消息框提示" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.TipEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="发送邮件" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.MailEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="上传到报警服务器" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.MessageEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="消息上传到网络" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.MsgtoNetEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="蜂鸣" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.BeepEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="语音提示" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.VoiceEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="联动视频矩阵通道掩码" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.MatrixEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="联动视频矩阵" :tips="AlarmNetAbort.EventHandler.MatrixMask" :more="false"></j-cell>
			<j-cell title="日志" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.LogEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="Ftp上传" :more="false">
				<view slot="tips">
					<switch :checked="AlarmNetAbort.EventHandler.FtpEnable" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="语音提示类型" :tips="AlarmNetAbort.EventHandler.VoiceType" :more="false"></j-cell>
		</j-cell-card>
	</j-cell-group>
</template>

<script>
export default {
    data() {
        return {
            token: '',
            AlarmNetAbort: {
                Enable: '',

                EventHandler: {
                    EventLatch: '',
                    TimeSection: '',
                    RecordMask: '',
                    RecordEnable: '',
                    RecordLatch: '',
                    AlarmOutMask: '',
                    AlarmOutEnable: '',
                    AlarmOutLatch: '',
                    PtzEnable: '',
                    PtzLink: '',
                    TourEnable: '',
                    TourMask: '',
                    SnapShotMask: '',
                    SnapEnable: '',
                    TipEnable: '',
                    MailEnable: '',
                    MessageEnable: '',
                    MsgtoNetEnable: '',
                    BeepEnable: '',
                    VoiceEnable: '',
                    MatrixEnable: '',
                    MatrixMask: '',
                    LogEnable: '',
                    FtpEnable: '',
                    VoiceType: ''
                }
            }
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        console.log(options);
		this.token = options.token
		this.getconfig();
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        getconfig() {
            uni.showLoading();
            let token = this.token;
            let data = {
                Name: 'Alarm.NetAbort'
            };
            getApp().globalData.api.getconfig(data, token, (result) => {
                uni.hideLoading({
                    success: (res) => {
                        console.log(result);
                        this.AlarmNetAbort = result['Alarm.NetAbort']
                    }
                });
            });
        }
    }
};
</script>
<style></style>
